feat(apt-clean): skip immutable clean and merge cache sizes in print-json mode#446
feat(apt-clean): skip immutable clean and merge cache sizes in print-json mode#446electricface wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Sorry @electricface, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: electricface The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin pr auto review★ 总体评分:65分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 diff --git a/src/lastore-apt-clean/main.go b/src/lastore-apt-clean/main.go
index 4470209e4..corrected_hash 100644
--- a/src/lastore-apt-clean/main.go
+++ b/src/lastore-apt-clean/main.go
@@ -14,6 +14,7 @@ import (
"io"
"os"
"os/exec"
+ "path"
"path/filepath"
"syscall"
"time"
@@ -79,18 +80,17 @@ func main() {
findBins()
// Handle immutable system cache if incremental update is enabled
- var immutableCache *immutableCacheOutput
cfg := config.NewConfig(path.Join("/var/lib/lastore", "config.json"))
+ var immutableCache *immutableCacheOutput
if cfg.UseIncrementalUpdate() {
- if true {
if options.printJSON {
var err error
immutableCache, err = queryImmutableCacheSizes()
if err != nil {
logger.Debugf("failed to query immutable cache sizes: %v", err)
}
} else {
err := exec.Command(binImmutableCtl, "upgrade", "clean").Run()
if err != nil {
logger.Debugf("failed to clean immutable cache: %v", err)
}
}
+ }
}
|
|
@electricface: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
…json mode When running with --print-json, lastore-apt-clean no longer executes deepin-immutable-ctl upgrade clean. Instead it queries cache sizes via --print-cache-sizes and appends immutable debtree cache info to the JSON output. - Add binImmutableCtl constant to replace hardcoded command name - Add queryImmutableCacheSizes() and supporting types - Merge immutable debtree cache into archivesInfos output - Guard JSON marshaling with options.printJSON check
3deb3c6 to
b9a9f3f
Compare
When running with --print-json, lastore-apt-clean no longer executes
deepin-immutable-ctl upgrade clean. Instead it queries cache sizes via
--print-cache-sizes and appends immutable debtree cache info to the
JSON output.